// ===== Work 相关 API 方法 =====

// 工作台登录
export const workLogin = (data, config = {
    custom: {
        auth: false
    }
}) => uni.$u.http.post('/work/login', data, config);

// 更新工作密码
export const updateWorkPwd = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/work/updatepwd', data, config);

// 获取工作台首页数据
export const getWorkHome = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/work/home', data, config);

// 获取教师详情信息
export const getWorkDetail = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/work/teacher/detail', data, config);

// 更新教师信息
export const updateWorkInfo = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/work/teacher/update', data, config);

// 获取教师信息详情
export const getWorkInfo = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/work/teacher/getTeacherInfoDetail', data, config);

// 获取教师可预约天数
export const getWorkDays = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/teacher/getTeacherDays', data, config);

// 获取时间详情
export const getTimeDetail = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/teacher/timeDetail', data, config);

// 获取教师详情（通过ID）
export const getWorkDetailById = (id, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.get(`/teacher/${id}`, config);

// 添加教师
export const addWork = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/teacher/add', data, config);

// ===== Meet 相关 API 方法 =====

// 会议前置检查
export const beforeJoinMeet = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/meet/before_join', data, config);

// 加入会议
export const joinMeet = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/meet/join', data, config);

// 获取会议加入详情
export const getJoinDetail = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/meet/joinDetail', data, config);

// 获取会议日历有数据的天数
export const getCalendarHasDay = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/meet/hasDay', data, config);

// 获取会议列表
export const getCalendarList = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/meet/list', data, config);

// 获取会议当日列表
export const getMeetDayList = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/meet/dayList', data, config);

// ===== 预约相关 API 方法 =====

// 核销预约
export const writeOff = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/writeOffRecord/writeOff', data, config);

// 取消核销
export const cancelWriteOff = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/writeOffRecord/cancelWriteOff', data, config);

// 更新预约状态
export const updateReservationStatus = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/reservation/updateStatus', data, config);

// 按时间槽取消预约
export const cancelReservationBySlot = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/reservation/cancelBySlot', data, config);

// 删除预约
export const deleteReservation = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/reservation/delete', data, config);

// ===== 课程相关 API 方法 =====

// 获取课程列表
export const getCourseList = (params = {}, config = { 
    custom: { 
        auth: false 
    } 
}) => uni.$u.http.get('/course/list');

// 获取工作台可预约天数
export const getWorkDaySet = (data, config = {
	custom: {
		auth: false
	}
}) => uni.$u.http.post('/work/dayset', data, config);

// ===== 兼容性导出（保持向后兼容） =====
// 为了平滑迁移，保留原有的导出名称
export const teacherDetail = getWorkDetail;
export const updateTeacherInfo = updateWorkInfo;
export const teacherInfo = getWorkInfo;
export const getTeacherDays = getWorkDays;
export const getTeacherDetail = getWorkDetailById;
export const addTeacher = addWork;
export const before_join = beforeJoinMeet;
